/**
 * @评论框
 */
import { cycle } from '@/utils/cycle';
import { Comment, Avatar } from 'antd';

interface IProps {
  children: any
}
const ExampleComment: React.FC<IProps> = (props) => {
  return <Comment
  actions={[<span key="comment-nested-reply-to">{props.children.userAgent}{` 大约${cycle(props.children.createAt)}`}</span>]}
  author={<a>{props.children.name} {props.children.replyUserName?`回复 ${props.children.replyUserName}`:null}</a>}
  avatar={<Avatar src="https://joeschmoe.io/api/v1/random" alt="Han Solo" />}
  content={
    <p>{props.children.content}</p>
  }
>
  {
    props.children.children?props.children.children.map((item: any)=>{
      return <ExampleComment key={item.id} children={item} />
    }):null
  }
</Comment>
}
export default ExampleComment